package section1;
/*
	Sample Input
	3
	4 1 2 3 4
	5 1 2 3 4 5
	3 1 2 3
	Sample Output
	
	10
	
	15
	
	6
*/
import java.util.Scanner;
public class PracticeVIII {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n,m,sum;
		n = sc.nextInt();
		while((n--)>0){
			sum = 0;
			m = sc.nextInt();
			for(int i=0; i<m ; i++){
				sum += sc.nextInt();
			}
			if(n==0){
				System.out.println(sum);
			}else{
				System.out.println(sum);
				System.out.println();
			}
		}
	}
}
